package com.abuaziz.librarys

import android.os.Bundle
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import com.ug_project.adapters.createViewPagerAdapter
import com.ug_project.views.FONT_NAME
import com.ug_project.views.font
import kotlinx.android.synthetic.main.activity_tab_layout.*

class TabLayoutActivity: AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_tab_layout)
        (window.decorView as ViewGroup).font = FONT_NAME
        val mTitles = arrayOf("ئاندىرويىد", "ئالما", "نەشپۈت", "چىلان", "ياڭاق", "قوغۇن", "تاۋۇز")
        val views = ArrayList<View>()
        mTitles.forEach {
            views.add(View(this))
        }

        vp.adapter = createViewPagerAdapter(views.toTypedArray(), mTitles)
        tl_2.setViewPager(vp,mTitles)
    }
}